//
//  TxLiveFactory.m
//  tx_live_plugin
//
//  Created by FXY on 2022/6/26.
//

#import "TxLiveFactory.h"

#import "TxLivePlatFormView.h"

@implementation TxLiveFactory
{
    NSObject<FlutterBinaryMessenger> * _messenger;
}

- (instancetype)initWithMessenger:(NSObject<FlutterBinaryMessenger> *)messenger{
    self = [super init];
    if(self){
        _messenger = messenger;
    }
    return self;
}

- (NSObject<FlutterMessageCodec>*)createArgsCodec {
    return [FlutterStandardMessageCodec sharedInstance];
}

- (nonnull NSObject<FlutterPlatformView> *)createWithFrame:(CGRect)frame
                                            viewIdentifier:(int64_t)viewId
                                                 arguments:(id _Nullable)args {
    return [[TxLivePlatFormView alloc] initWithFrame:frame viewId:viewId arguments:args binaryMessenger:_messenger];
}
@end
